http://www.maliburacing.com/forum/viewtopic.php?t=41226
http://www.the12volt.com/relays/relays.asp
This would be a good read.
In short, you connect either 85 or 86 on the relay to your ignition-switched source, and the remainder of the two you connect to a ground. Then you can wire the voltage source to 30, and the fan to either 87a or 87 (whichever is off without the relay being 'triggered' by the ignition, I seem to remember seeing both), or vice versa.
When I did mine, to help keep from running wire from the battery, I connected a 10ga. wire to the terminal on the back of the alternator (with a fuse close to this connection of course, used a 30A), ran that to the relay -> thermal switch (mine is adjustable) -> fan -> ground. My voltage source was pigtailed off some wire I found under the hood that was hot with the ignition... I think it wound up being the oil pressure gauge/switch wire for the sending unit now that I think about it (it was brown), but if I were to do it over, I would use a dedicated 12v-switched wire.