What exactly do D+ and D- on a USB connection do?
The D+ and D- transfer data between host and device. They are also used for initial plug-in detection so host knows when to start enumeration with device.

Differential just means that both data pins have signal but transmitter drives these with opposite logic levels. Receiver compares D+ to D- to receive data, so data line voltages are not compared to ground as it may contain noise.

Software or the USB driver communicates with USB host peripheral chip to transfer data packets, software does not directly have control over D+ and D- pins.