Get some sort of USB audio interface. Here's an inexpensive option: Behringer U-Phono UFO202 USB Audio Interface
. In the case of this particular device, you'd also need the appropriate adapter cable.
Using the headphone output is fine, but be careful not to blast your computer: make sure that the volume on the cassette player is at 25% or less.