you can fine some excelent firmwares and programs (in VB and VC++) in "USB Complete" book from John Axelson.She has developed a good example for a HID device which includes both sides,PC and USB device.The program for PC includes some API functions which you can use for other USB classes too,only have to implement its speciall specification.
Her site is www.lvr.com which you can download the source code from.It's free too.
Another implementation and source code for USB is done by Jhon Hyde on intel site www.intel.com