This documentation is aimed at application developers wishing to communicate with USB peripherals from their own software. After reviewing this documentation, feedback and questions can be sent to the libusb-devel mailing list.
This documentation assumes knowledge of how to operate USB devices from a software standpoint (descriptors, configurations, interfaces, endpoints, control/bulk/interrupt/isochronous transfers, etc). Full information can be found in the USB 2.0 Specification which is available for free download. You can probably find less verbose introductions by searching the web.
One decision you will have to make is whether to use the synchronous or the asynchronous data transfer interface. The Synchronous and asynchronous device I/O documentation provides some insight into this topic.
Some example programs can be found in the libusb source distribution under the "examples" subdirectory. The libusb homepage includes a list of real-life project examples which use libusb.
The libusb_set_debug() function can be used to enable stdout/stderr logging of certain messages. Under standard configuration, libusb doesn't really log much at all, so you are advised to use this function to enable all error/warning/informational messages. It will help you debug problems with your software.
The LIBUSB_DEBUG environment variable can be used to enable message logging at run-time. This environment variable should be set to a number, which is interpreted the same as the libusb_set_debug() parameter. When this environment variable is set, the message logging verbosity level is fixed and libusb_set_debug() effectively does nothing.
libusb can be compiled without any logging functions, useful for embedded systems. In this case, libusb_set_debug() and the LIBUSB_DEBUG environment variable have no effects.
libusb can also be compiled with verbose debugging messages. When the library is compiled in this way, all messages of all verbosities are always logged. libusb_set_debug() and the LIBUSB_DEBUG environment variable have no effects.