I struggled with this idea for a long time. I have an F50, which has a line out that's supposed to have some EQing to make it speaker emulated, but by itself it sounds like crap. I happened to have a Tech 21 TRI OD laying around and remembered it has a speaker simulator function, so I decided to try running the signal through that. I was much improved (though the signal from the line out is really too hot, but if I keep the master around 9-9:30 it works). Then I threw a 7-band EQ pedal in between the line out and TRI OD and finally got a useable signal...it actually sounds pretty decent, but still not as good as mic'ing the speaker.
Recently I got a Weber Mini Mass attenuator that has a line out on it and this takes the signal from the speaker out (whereas the line out on the F50 is from the preamp). (This kind of device is probably what you'd need to get if your amp doesn't have a line-out feature on it, it can more or less silence your speaker if you need to while providing a constant impedance to your speaker and provide you with a line out at the same time. There is also the THD Hotplate and Dr. Z Air Brake, but the Weber is by far the best priced, depending on which model you get.) I found I still needed to run the signal through the EQ and TRI OD and the result was acceptable, but not quite as good as using the line out signal and certainly not as good as mic'ing the speaker.
I've been tempted by those DI's that have cab sims built into them, but frankly, I bet it's still inferior to mic'ing.