You cannot wiggle the data lines of USB like that. They are not GPIO pins. They a driven by a hardware USB circuit.
Even if you could you would find it next to impossible to wiggle those pins fast enough to talk to any standard USB peripheral.
Even if you could do that you would have to write all the code for the USB communications protocol. That is not a small or pleasant job: https://www.beyondlogic.org/usbnutshell/usb1.shtml
The specification is a huge document.
If you don't actually want to talk to standard USB devices or use the USB protocol then why not just use a couple of GPIO pins to do what you want? If you want a regular serial link without a USB adapter why not use the UART on the Pi's GPIO pin header?
I guess you could write your own driver for the Pi's USB hardware, then you could probably instruct it to send and receive packets whenever and how ever you like. With total disregard of the actual USB protocol. In which case get a copy of the Linux kernel source code and have a look at the existing USB driver module.
Memory in C++ is a leaky abstraction .