We prove sectional and Ricci-type comparison theorems for the existence of conjugate points along sub-Riemannian geodesics. In order to do that, we regard sub-Riemannian structures as a special kind of variational problems. In this setting, we identify a class of models, namely linear quadratic optimal control systems, that play the role of the constant curvature spaces. As an application, we prove a version of sub-Riemannian Bonnet-Myers theorem and we obtain some new results on conjugate points for three dimensional left-invariant sub-Riemannian structures. 14 4. Microlocal comparison theorem 15 4.