You can communicate with ESP32 serial interface USB cable.
You can use the same code as in Hello World example:
esp32-examples/examples/Hello World/sketch/sketch.ino
Lines 1 to 8 in 19d93d1
You can use Tools > Serial Monitor or any other serial client like Putty to read data from the serial port.
You can use Arduino IDE Serial Monitor using Tools > Serial Monitor or any other serial client like Putty to send data to the serial port.