I've done it, although I just wired a 6.35mm (1/4") socket to a 3.5mm plug. My soundcards mic input was stereo, so I just wired the tip and ring together.
As Nigel rightly mentioned, the input impedance of soundcards, both mic in, and line in, is usually quite low, <10k. Guitar amps usually have a much higher impedance, up to a few Megaohms for valve amps. The result of plugging a guitar direct into the sound card will be a loss of highs - but it should work! And can be fun if you use Native instruments guitar rig 3, or 'amplitube'.
If you want to make a 'buffer', to convert the impedance (high Z to low Z) I'm sure people around here would be willing to assist. Usually a single transistor circuit is enough, like the tillman preamp.