One solution is to use flexible cables, locks, and adhesives (see Tryten for some examples). This offers a simple and inexpensive solution.
I also found a clever solution called iAnchor. The iAnchor physically fixes an iMac computer to a tabletop or desk surface. It also secures the keyboard and mouse cables so that these devices stay with your Mac. UPDATE: iAnchor website is no longer available so I assume this product is no longer available. I leave the pictures here in case someone else needs ideas.
If your iMac does get stolen, there is some hope – there is a software solution called Undercover (http://www.orbicule.com/undercover/mac/) – Have a look at their guided tour – pretty neat stuff.
Note that I haven’t actually tried these solutions and there is probably more that can be found on the Internet.