The Pi Zero (and Zero W) have support for acting as a USB gadget: that means that they can be configured to act as a USB device – like a serial port, an ethernet interface, a mass storage device, etc.

There are two different ways of configuring this support. The first only allows you to configure a single type of gadget at a time, and boils down to:

  1. Enable the dwc2 overlay in /boot/config.txt
  2. Reboot.
  3. modprobe g_serial

This process is more fully documented here.