In the case that a device does not provide its own serial number, one is provided by the operating system when the device is connected. Some hardware will have specific serial numbers built-in by the manufacturer, but most do not.
All USB devices are identified by the operating system (such as Windows XP) using a unique serial number.