Windows:
- Connect the device to the PC
- Open Windows Device Manager
- Expand "Universal Serial Bus Controllers"
- Right-click "Apple Mobile Device USB Driver", and click "Properties"
- Under the "Details" tab, select "Device Instance Path" in the drop-down
- The 40 characters after the last "\" under "Value" is the device's UDID
OS X:
- Connect the device to the PC
- Click the Apple icon in the Menu Bar
- Select "System Information"
- Expand "Hardware" and select "USB"
- Find and select your device under the "USB Device Tree"
- The value listed as the "Serial Number" is not really the device's serial number, but is its UDID