There are two basic approaches, you can tap a speed sensor directly before it reaches the computer, or use OBD II signals (generated by the computer).
Sensors usually generate a voltage, so you have to find the wire you are interested in and then install an analog-to-digital converter. This then has to either go directly to a COM port (if your computer has one) or to a USB reader designed to accept digital signals of the type the ADC generates. One complexity of using this approach is that you have to run a wire through the engine bulkhead.
Easier is to use is the OBD II information which you can access from a plug in the cabin. Usually the OBD II plug is hidden by a panel near the center console. You need an open-interface OBDII (non-proprietary) scanner and you hook it up to the serial port of your computer (or whatever it connects to). The OBDII system works like a terminal. You send it text commands which are just alphanumeric codes and it answers with data. Step-by-step instructions how to do this can be found on various web sites and would take too much space to reproduce here.
A third possibility would be to get the data from the Event Data Recorder. I would advise against messing with that thing, however, since it is connected to the airbag system.