You get the same pressure acting in both directions, and Newton's law says that momentum is conserved, so the momentum (mass x velocity) of the bullet + gas will equal the momentum of the gun, except that the sign will be opposite, because velocity is in the other direction.

So 'recoil' is based on the mass ratio of the gun versus the bullet. Shooting a heavier bullet will increase recoil, shooting a lighter gun will also increase recoil.

Pressure x area is force, so 50,000 PSI x 0.01 Square Inches (9mm base), means 500 lb of force acting on the bullet. F=ma, so 500lb divided by 115 grains (plus powder load) will give you an acceleration. Acceleration x time will give you a speed, so multiply the acceleration by barrel time and you get a muzzle velocity. Obviously it is never as easy as that, because you lose some force due to friction, the chamber pressure is not constant, bla bla bla, but the concept gets you started. That SAME 500lb force is acting on the gun, for the same amount of time, but say a gun weighs 2lb (14,000 grains) instead of 140 grains (bullet plus powder), so if the bullet achieves 1,000 fps, the gun will achieve 10 fps.... or at least a revolver will. A semi gets messy, because some of the energy is used to compress the slide spring.

A squib only needs enough energy to compress the slide spring. bleep it, now I'm thinking I need to take apart a gun and measure the slide spring to calculate how much energy. I need another project like I need a hole in the head, but bottom line is that despite being messy, you can probably get within 20%, despite the simplification of the math.