There are various solutions for the ultrasonic cleaners, some formulated directly for firearms. I would think following their directions wouldn't hurt.
Once out of the unit a complete drying and a follow-up lubrication would be the way to go. Can't imagine the contact points Ivan mentioned wouldn't have been positively affected (read that as "cleaned") along the way, though.
Removing the assemblies (if broken down) or the entire gun (say a J-frame) from the machine and working the action a couple times along the way couldn't hurt the process, I wouldn't think...?
Needless to say, all used guns (new to me) get their bath ASAP.
CHEERS!
P.S. Personally I regularly do a normal cleaning (fieldstripping, if you will?) of all my guns after every trip to the range UNLESS I am planning to return to shoot them again in the forseeable future... As in a couple days/a week.
I don't find this onerous because I prefer to insure that they will be ready the next time I use them. Quite often I will also offer to clean (not in the ultrasonic cleaner, BTW!) any of the guns my guests may have brought to the range: it is a good way to determine their condition. I also routinely inspect any of these guest guns prior to them actually being used: I feel it is my responsibility as host to do everything I can to insure there are no problems that could easily be avoided with a little effort.
Yes, I've read many of the torture tests, the "I've NEVER cleaned my GLOCK atter X-THOUSAND rounds!" testimonials, often with sincere appreciation, but...
I still believe a clean gun is still going to have less potential (and actual?) problems when called upon to perform, regardless of the seriousness (or not?) of the situation.