See this thread...

USBinit and USBservice
http://www.picbasic.co.uk/forum/showthread.php?t=3443