I would suggest you to try and get some inspiration with my USBDemo.
http://www.picbasic.co.uk/forum/show...hlight=usbdemo