Companies like PCCables make microUSB or USB-C to serial adapters (and supply drivers). so you write to the phone's USB port (and specify which adapter the user has to buy). Transferring the data by Wifi or Bluetooth is a lot easier (and cheaper) for the user, and PCs today should have at least internet capability to connect to the same LAN that the phone is on. (You may also have to develop the PC-end software, and if you're doing this for an app to be released, you'd probably have to do it for Windows, MacOS and Linux.)