A calculus for higher spin interactions