We prove that the central values of additive twists of a cuspidal $L$-function define a quantum modular form in the sense of Zagier, generalizing recent results of Bettin and Drappeau. From this we deduce a reciprocity law for the twisted first moment of multiplicative twists of cuspidal $L$-functions, similar to reciprocity laws discovered by Conrey for the twisted second moment of Dirichlet $L$-functions. Furthermore we give an interpretation of quantum modularity at infinity for additive twists of $L$-functions of weight 2 cusp forms in terms of the corresponding functional equations.