How to log data written/read to/from a usb device?

(imported topic written by bc6591)

Is there a way to log data written to or read from a usb device? If not are there any open source (or not) ways of doing this? Thanks