Hello @bryan_hong
Thank you for your question.
The OTG protocol is quite complex and has largely been phased out. Using a pin to detect and switch between host and device is a simpler approach.
Please refer to the pin_detect_hid_mouse demo under SDK for reference.

When running the demo,
Host:
Plug in a mouse to the test board. The board acts as an USB host. The stack switches to host mode and some device attached information is printed out.
Device:
Unplug the mouse with the cable. The board now acts as a USB device mouse. The mouse is detached and the USB switches to the device mode information.
Hope it helps.
BR
Alice