Granular materials are large sets of macroscopic particles that interact solely via contact forces. The static behavior depends on the contact network and on the surface friction forces between grains; when they are set in motion (typically by vibrations) their dynamics is dominated by inelastic collisions. For these reasons granular media show an extremely rich phenomenology, ranging from fluid-like properties (if strongly vibrated), to "jamming", glassy, behavior (if weakly vibrated), to aging and hysteretical phenomena observed when they become trapped in frozen, amorphous states. The objective of this work is to study these states and transitions, and to characterize the analogies found between the dynamic behavior of vibrated granular media and the glass transition observed in thermal glass-formers. These analogies justify the interest in granular materials, because granular media can be seen as simplified model systems useful in the study of out of equilibrium thermodynamics, and, in general, to the larger framework known as "complexity". The granular materials considered here are composed of spheric, polished glass spheres. Since the surface state plays an important role in the grain-grain interaction, some measurements were also performed with acid etched beads, having different surface roughness. The samples are vertically vibrated to achieve vibrofluidization. Different kinds of vibration are used, to highlight different properties of the system. We first consider the transition between the fluid and the subcooled glassy phase, using different experimental techniques. The most important one is a torsion oscillator, that interacts with the granular media via immersed probes. The torsion oscillator can be used in forced mode. A torque is applied on the probe, and we measure the mechanical response function (complex susceptibility). In general, a relaxation is found and it is interpreted as the signature of the irreversible energy loss (damping) in granular collisions. This relaxation has an intrinsic time scale, and systematic analysis of it shows that a clear parallel can be traced to the behavior of "strong" glasses. In particular, it is found that (i) the relaxation time is a function of a unified control parameter, proportional to the square root of the average vibration, and phenomenologically equivalent to an effective temperature; (ii) the functional form with which the relaxation times approach the final "frozen" state has an Arrhenius, or Vögel-Fulcher-Tamman (VFT) behavior. The same torsion oscillator is employed in free mode. In this case, no external torque is applied, and the probe moves adapting its position under the effect of the continuous rearrangements in the sample. The system is studied by computing the power spectral density of the (angular position) time series. The resulting spectra represent a "configurational noise" as the system randomly hops from one configuration to the following. This allows to define, using