Morphology and electronic structure of nanostructured carbon films embedding transition metal nanoparticles