Controlling an electromagnet with Arduino
Although I have never controlled an electromagnet from a microcontroller before - I have controlled high voltage loads, so the same principle applies. You can use discrete componets such as transistor pairs or you can use something called an HBRIDGE to drive the high voltage/current application.

Here is a tutorial on controlling high current loads with a transistor and an Arduino. Here is a similar tutorial that powers a motor with an H-Bridge instead. To use these tutorials simply replace the motor with your electromagnet. It shows how to use external power sources and everything.

This is more of a conceptual answer so it's application will vary slightly with your configuration. For the most part however this should get you on the right track.