Previously, I’d have simply pointed someone to this AdaFruit Article as the Kernel Modules weren’t included in the stock kernel.
Not the case anymore, as the Kernel GitHub Repository currently has all the changes needed for USB Gadget Mode to function.

Most Raspberry Pi images include the utility rpi-update, using this tool and a one-liner, you can update your Kernel to a version which has the Modules required.

Update Kernel and load Kernel Modsview raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash
#Updates Kernel to next Branch
sudo BRANCH="next" rpi-update;

#Load Overlay
echo "dtoverlay=dwc2" | sudo tee -a /boot/config.txt

#Load one of the G_xxx Modules (g_ether in this case)
#dwc2 is required only when automatically loading a g_ module,
#due to dwc2 being autoloaded after /etc/modules is read.
echo "dwc2" | sudo tee -a /etc/modules
echo "g_ether" | sudo tee -a /etc/modules

#Configure the new Network Interface to register over DHCP
echo "allow-hotplug usb0" | sudo tee -a /etc/network/interfaces
echo "iface usb0 inet dhcp" | sudo tee -a /etc/network/interfaces

if you are using an image which does not come with rpi-update, don’t worry, its very easy to install - Check it out here

You can do all of this preperation (including rpi-update, which can be done from a different system with a mounted SD Card, see instructions at the rpi-update GitHub Page) before sticking the MicroSD Card into the Pi Zero, so that it can be ready to be accessed, updated and controlled via a single MicroUSB Cable. Fantastic!

Already have 2 Pi Zeros on my hands, got another one coming from Pimoroni that I won during one of their Bilge Tanks, and another from MagPi hopefully. 2 More on top of that and I’ll be building (and documenting) a simple Cluster of Raspberry Pi Zeros, that’ll be fun!

Refs:
GitHub PR for the Kernel Changes that are used here