In this thesis, we are interested first in the sub-Riemannian problems on 2-step nilpotent Lie groups. We start by obtaining a complete classification of 2-step nilpotent sub-Riemannian Lie algebras (SR-Lie algebras) of dimension n between 3 and 7, and those of arbitrary dimension n such that the derivated algebra is of dimension one. In addition, we characterize the contact and quasi contact SR-Lie algebras and we calculate, in dimension 5, the group of SR-infinitesimal symmetries. Having presented that classification, we study the sub-Riemannian geodesics associated with the 2 step nilpotent SR-Lie algebras obtained in our classification. We study the integrability of the adjoint geodesic equations and we give the optimal controls and optimal trajectories in each case. In the second part of the thesis, we study the sub-Riemannian geodesics for a sub-RiemannianLie group (G;D;B) where G = SO(4) or G = SO(2; 2) and D is of codimension 2 (giving contactSR-homogeneous spaces). We give canonical models of these spaces and then show that the Lie-Poisson adjoint systems associated with the models are always integrable in the Liouville sense. More over, we show that the Lie-Poisson system is either a linear system which is super-integrable with the help of trigonometric functions of time (or constant ones) or a non-linear system which is integrable in the Liouville sense and whose solutions can be expressed using the Weierstrass elliptic function.