We calculate the superconducting transition temperature Tc for the refractory compounds ZrC, YS, NbC and NbN. The electronic properties are obtained by means of a cluster approach while the lattice dynamics is described by double shell models. Our results indicate a strong enhancement of Tc by optical phonons