The comprehension of the formation of galaxies and the origin of supermassive black holes present in their centres are probably one of the great challenges of modern cosmology. An adequate theory of galaxy formation must be able to explain the origin of the different morphological types, the properties of the stellar populations as well as the observed correlations between the mass of the central black hole and the integrated properties of bulge systems. The complexity of such a task requires often the use of cosmological simulations, since pure analytical or semi-analytical approaches cannot take into account all different physical aspects of the problem. Our team performs simulations with the parallel TreePM-SPH code GADGET- in a formulation, despite the use of fully adaptive SPH, that conserves energy and entropy. Gas processes like the ionization balance, cooling and heating were included as well as star formation, their evolution and feedback. These feedback processes, consequence of the stellar evolution, are essentially the return of mass into the interstellar medium, the local gas ionization by the UV-radiation of young massive stars and the injection of mechanical energy by supernova explosions. The gas chemical enrichment by the ejecta from both supernova types (II and Ia) is also followed. The code takes also into account the growth of black holes by accretion and merger episodes and their feedback during the AGN phase Our very first investigations, using these cosmological simulations, permitted to have a better understanding of the mechanism by which galaxies acquire their angular momentum and of the mechanisms by which dark matter halos relax dynamically. Our present investigations are focused on the dynamic and on the spectrophotometric properties of simulated elliptical galaxies as well as on the properties of supermassive black holes, their correlations with those of the host galaxies and the evolution of such properties with the redshift. It is worth mentioning that even the highest mass resolution simulation ever realized is not yet able to describe the physics near the black hole horizon, reason why the accretion process is still badly modelled in cosmological simulations. This specific problem is being studied by true hydrodynamic simulations, in which the evolution of a self-gravitating non-steady disk around a black hole is followed. These simulations will give information about the typical accreting timescales (or the black hole growth timescale) as a function of the gas viscosity and mass and how the disk luminosity varies with time.