In this thesis manuscript, we present a theory describing the coupling between the quantized electromagnetic field of a cavity resonator and the cyclotron transition between Landau levels in a two-dimensional electron gas in presence of a perpendicular magnetic field. We show that such a system can reach an unprecedented ultrastrong coupling regime, where the vacuum Rabi frequency (quantifying the strength of the light-matter interaction) can be comparable or bigger than the cyclotron transition frequency for large enough filling factor. Our theoretical predictions have been demonstrated by spectacular experimental results. Moreover, we have generalized the theory to the case of graphene, whose low-energy excitations are described by a massless Dirac Hamiltonian. We show that the ultrastrong coupling can be also achieved for graphene, leading to strong qualitative differences with respect to the case of massive fermions in a semiconductor.