To get line-in/mic-in to play through the speakers all you have to do is
set the playback mixer to unmute that input. On XP run "sndvol32". On
Vista the mixer may or may not allow it depending on the soundcard in which
case you would have to write an app to capture the input and echo it back
out. To connect a line level signal to a mic input you will need a special
cable that has resistors in series in order to drop the voltage level from
1V p-p to 50-100mV p-p. The signal will also become mono.
[MS MVP for DirectShow / MediaFoundation]