I do this with "Garage Band" - a program that comes bundled with all new Macs. It is essentially a mult-track recorder and sequencer, but done with that great Apple ease-of-use and style. (Ah, as easy to use as a mult-track recorder and sequencer gets....)
First I plug my guitar into my Mac. If your guitar puts out a strong enough (but not overpowering) signal, you can plug into the mic-jack, or even line-in. I use a Presonus Firebox audio interface, which has a good pre-amp built into it.
You then specify in Garage Band that this instrument is the input device for a track, and then specify the effects to be applied to this track. These effects include simulations of different guitar amps, as well as all the tweaking controls for each model.
The effects are applied in real-time, with the end result piped out the computer speaker (or headphones). It's a blast to jam away on an acoustic with a pick-up, and have a big-metal sound come pouring out with every strum!
Don't like the amp simulation on that perfect lick you just laid down? Simply change the effect preferences for your track - the old effects get erased, and the new effects get applied. At least 4 amps are included in Garage Band, and more are available as 3rd party add-ons.
So, with this setup, I can jam away, trying all different (virtual) kinds of amplifiers & settings, and even just listen to it through headphones when I don't want to bother the neighbors.
Don't electric guitars need a DC voltage supplied on the input? The older Macintosh computers had an audio input jack with a voltage output on one of the pins (so it could be used either as a line-in [not using the voltage output] or electret microphone input [using the voltage output]. No idea what current ones do.