Take a look at Getting Started with the Arduino Leonardo, Leonardo ETH and Micro, with special attention to section "Separation of USB and serial communication".
Take a look at Getting Started with the Arduino Leonardo, Leonardo ETH and Micro, with special attention to section "Separation of USB and serial communication".