Bombardment of planetary rings by meteoroids: General formulation and effects of Oort cloud projectiles