If you are directly interacting with the USB device, you'll need to know this stuff: http://www.lvr.com/usb.htm
A joystick is a "Human Interface Device" (or HIB) class in the USB nomenclature.
I've never played with USB ports directly myself (and would like to avoid it if at all possible in the future), so that is about all I know about it.