Best bet is to download the Microchip Library of Applications (MLA) and find the help_mla_usb.pdf file to read about the USB framework and functions. There are demos for CDC and USB-Serial applications, designed for their low pin count USB demo board which has the PIC18F14K50 but can be used with the PIC16F145x. The board is $40 but has only a few parts so you could easily make your own:
formatting link
Data Sheet with schematic:
formatting link
I have implemented USB on my own ORTM-4H product, using the PIC18F2550, but I had to use the older USB stack and the C18 compiler (and perhaps also the
8.9x IDE). You may download what I have - which includes some changes to the stack that appear to work - but it's not completely debugged, and the newer stack probably takes care of these issues that I had with XC8 a few years ago:
formatting link
There is also a lot of information on the Microchip forum where I (and others) discussed the problems.
It's supposed to be a software-only implementation of USB.
You may also look around the web for 'Igor ?e?ko' who apparently inspired people to write these software-only implementations and perhaps 'V-USB' whose homesite has a page full of links. One of those links is the above code.google.com one.
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.