I would model the recoil as a damped spring:
x : the current amount of recoil (this should decay exponentially after firing)
v : rate at which x is changing
k : spring constant
d : damping factor (must be between 0 and 1, where 1 is no damping. Try something like 0.9 for starters)
When the gun is fired you would add something depending on the gun's power to v:
v += gunpower
Then every frame:
angle += v
v += -k*x
v *= d
You'll need to find good values of k, d, and gunpower. Also, if there is not enough damping you could get oscillations.
Finally you'll want to get the angle and backward movement of the gun:
angle = x*angleFactor
backMovement = x*moveFactor
Where angleFactor and moveFactor are different for different guns as Troncosco said.
Disclaimer: I didn't actually test this yet but should work, maybe with a little tweaking.
Actually I thought it would be fun to whip up a quick example with Processingjs: http://kramin42.github.io/recoil.htm
(click inside the box to simulate firing, try clicking rapidly too)