You could implement an ability to have child objects for an object (where child objects would be automatically affected by changes to the position/rotation of parent). Then upon collision when they should latch together, you make an invisible object and make both of the attached objects its children. Then, instead of applying transformations (movement, rotation) on the individual objects, you apply it on the big one, OR you could still apply forces to the individual children objects, which would check "do I have a parent?", and if yes, the force would be sent to the parent (which would merge forces from all child objects into one vector it would apply to itself).
Also, this approach should properly handle their rotation, if you calculate center of mass for the invisible parent according to weights of the latched objects, which John's method doesn't seem to accomplish (joined object rotate around their new shared center of mass, not around center of mass of one of the objects), and you could easily nest this kind of behavior without any additional code required. It seems to be the more robust and flexible approach.
+condition if the force applied to child is strong enough to break the joint, and you can handle the "unlatching" of it by simply removing the parent->child relationship. If there's only one child left, you make it seperate too and remove also the invisible parent.
I can provide more details (with pictures and at least pseudocode and such) if you're interested.