Write the Raspberry Pi image to the Sd card by Win32DiskImager.exe software, Choose the image file and click "Write" to start. It may prompt to format the CM4 again after writing, just ignore it.
After writing, a disk named BOOT is recognized, go into the disk and modify the config.txt file. Add the line to the file: dtoverlay=dwc2,dr_mode=host
To finish, eject the BOOT disk from the host PC. Disconnect the USB cable and power adapter, disconnect the BOOT, and set the switch into OFF. restart the board and go ahead with the examples.
If you do not have a card reader, you can insert the SD card to the carrier board and write it just like the eMMC version.