abstract: This talk describes recent joint work with Fabrice Baudoin. We introduce a new class of sub-Riemannian manifolds of rank two which encompasses Riemannian manifolds, CR manifolds with vanishing Webster-Tanaka torsion, orthonormal bundles over Riemannian manifolds, and graded nilpotent Lie groups of step two. These manifolds admit a canonical horizontal connection and a canonical sub-Laplacian. We construct on these manifolds an analogue of the Riemannian Ricci tensor and prove Bochner type formulas for the sub-Laplacian. As a consequence, it is possible to formulate on these spaces a sub-Riemannian analogue of the so-called curvature dimension inequality. Sub-Riemannian manifolds for which this inequality is satisfied are shown to share many properties in common with Riemannian manifolds whose Ricci curvature is bounded from below. In particular, we obtain Li-Yau inequalities, uniform Harnack inequalities, isoperimetric and Gaussian upper bounds, and a sub-Riemannian Bonnet-Myers theorem