How to set USB as slave device on Nano?

If you don’t mind using ethernet, then the content is already there. The default is to have that port produce what looks like an ethernet router and DHCP server. If the host PC accepts it, then the host PC would create a network with IP address 192.168.55.100, and could ping or talk to the Jetson at address 192.168.55.1.

So far as customizing goes, you can only use the “gadget” convenience API for “standard devices” which use some standard class driver, e.g., keyboard/mouse/ethernet. If you want something else, then you will need to learn to write custom kernel drivers.