usb data transfer in host and device mode

hi
we have one beaglebone black board.
we want to try out one experiment where beaglebone board can act as device and will do usb communication (bulk transfer, control transfer, interrupt, achromous) with host (windows application / linux app).
similarly BBB as host and do (bulk transfer, control transfer, interrupt, achromous) with a device. plz provide examples for better understanding