DI stands for Direct injection...
Basically, one of these puppy's turns an unbalanced signal into a balanced signal. The electronics can be complicated, but there are two kinds. Passive (unpowered) and active (phantom powered).
Unbalanced signals are those found in
acoustic guitar pickups and keyboards. The thing with unbalanced signals is that they lose power over long distances - after 10 or 12 feet in your average guitar cable you'll start to lose signal strength and therefore 'tone'. You don't want to lose your tone do you?
A balanced signal can be run a much, much longer distance. I've run cables 100 feet and haven't noticed signal differences on the same source with a 10 foot cable. If you look at 250 foot snakes and you'll see that a balanced signal can be sent a long way. Preamps and Mics put out a balanced signal, and many types of gear use it simply because signal integrity is crucial in recording.
However, to answer your 2nd question, a DI box will turn an unbalanced signal into a balanced one, but it will not make a signal line level - something different. You need a preamp to make a 'guitar' signal go into your soundcard's line in. You would plug your guitar into a DI and then the DI into the Preamp, and then the preamp into the soundcard.
jacob