USB OTG explained in this app note from Cypress Semiconductors. Link here
This application note discusses several aspects of OTG functionality. The note introduces end-applications and different types of cables and connectors involved with OTG. It also describes the OTG protocol state changes when both Mini-A and Mini-B devices are connected .The host negotiation protocol (HNP) and session request protocol (SRP), which are part of the OTG protocol, are also explained.