If you are using PBP 2.50 or previous, disregard this post and use Squibcake's example at the beginning of this thread.
But you can still use USB_ASM_Service.pbp mentioned at the end of this post with Squibcake's example for easier servicing.

If you are using PBP 2.60, This might help.

With PBP 2.60, the way USB works has changed significantly.
You no longer need all those .inc .bas or .bal files for each chip, it automatically works with whatever chip you are using. The Ram usage is only 1 Bank now, which frees up a whole bunch of memory for your program. The asm routines have been optimized to only include what is needed for that protocol, which frees up more program space. All in all, they are just better.

And the best part is ... they're easier too.
There's an example from meLabs that works straight out of the box.

Copy the PBP\USB18 folder to a new location.
You do not want any files left over from previous versions of PBP, so don't try to copy it into an existing project folder.

Open and compile cdc_demo.bas with the proper chip selected.
Program the chip and test. Done deal.

When windows prompts you to install a driver, point it to the mchpcdc.inf file in the same folder.
Open a terminal program like HyperTerminal or equivelent and connect to the new COM port at any baud rate, it doesn't matter.
Press a key, and you should see "Hello World" returned.

Default configs are for a 20 Mhz crystal with 48 Mhz CPU (18F2455/2550/4455/4550 series).
18F13K50/14K50 must use 12Mhz crystal only.
0.22uF or higher capacitor must be on VUSB pin.

If it works, change the program as desired.
Don't change the program till it works ... it will work (if the hardware and configs are right).

NOTE: Long PAUSEs and USB don't mix.
Anything more than 10mS or so between servicing will cause the PC to disconnect the device.

Or you can add ...
Code:
INCLUDE "USB_ASM_Service.pbp"  ; USB Init and Service interrupt routines
and not worry about USBINIT or USBSERVICE at all.

USB_ASM_Service.pbp
http://www.picbasic.co.uk/forum/show...06&postcount=6

Cheers,