It is as simple as getting a DVI to DVI cable and hooking them up.
However rather than getting a switch box your best bet is to buy a cheap graphics card that has dual DVI outputs on it. The ATI X1650 is �30 at PC World.
The reason is that the resolution of your monitor and your TV will more than likely be different and to switch between the two will mean you have to keep changing your grpahics settings, this will soon become tiresome.
A dual output graphics card will allow you to treat your TV as an extension of your current desktop and drag windows and applications from one to the other. Lovely.
By the way, get your DVI cables from eBay or Amazon marketplace for the best prices though, not PC World ,they are a rip-off for cables!!