Another higher-hassle approach would be to shoot two frames of each setup -- a front focus area, and then a back focus area, and then strip them together, but trust me, it sounds easy, but it's not. Very time consuming, but sometimes, it's just necessary.
I know Helicon has already ben suggested, but CS4 can also do this. I recently demoed this feature using a product shot of 4 overlapping vials at varying distances, with 4 shots with camera focusing on each vial in turn. Open the images into a single PSD file using Bridge and then Blend. Works very well.
The aspect of lenses slightly changing focal length whilst focusing is called breathing and is why stills lenses on the new DSLRs that can do video, will not be as good for follow focusing as movie lenses which have this corrected out. Though when doing close up work, this should be less of an issue.