Are you using Unity3D or a different engine? If you’re using anything other than Unity3D, then you will be largely on your own. The best I could do is advise you on best-practices when it comes to implementing the stylus within legacy interaction systems.
We can probably assist with alternative engines, but you will have to pose your question in such a way that acknowledges our lack of context given that we probably know little to nothing about your engine’s input event system.
If you aren’t using Unity3D, but have a working familiarity with it, then I would recommend studying how that is implemented for inspiration within your own engine.
If you are using Unity3D and our zCore version 6.x.x, then you have access to a pre-made solution. ZInputModule and ZGraphicRaycaster are specially designed to extend Unity’s built-in event system. These enable our ZStylus and ZMouse objects to act as first-class citizens in Unity’s UI and 3d collider event system.
Be sure to check out the included sample script Draggable.cs. This is a good boilerplate 3d interaction script that showcases how zCore extends Unity’s interaction even system.
Be sure to read up on the documentation and explore the pre-supplied samples that come with zCore. If you still have questions, please feel free to follow up!