Nanocomposites consisting of nanoparticles of iron oxide (Fe3O4) and iron carbide (Fe3C) with a core-shell structure (Fe core, Fe3O4 and/or Fe3C shells) coated with additional graphite-like carbon layer dispersed in carbon matrix have been synthesized by solid-phase pyrolysis of iron-phthalocyanine (FePc) and iron-porphyrin (FePr) with a pyrolysis temperature of 900°C, and post-annealing conducted at temperatures ranging from 150°C to 550°C under controlled oxygen- and/or nitrogen-rich environments. A comprehensive analysis of the samples’ morphology, composition, structure, size, and magnetic characteristics was performed by utilizing scanning electron microscopy (SEM), high-resolution transmission electron microscopy (HR-STEM) with elemental mapping, X-ray diffraction analysis (XRD), and magnetic measurements by utilizing vibrating sample magnetometry (VSM). The effect of the annealing process on magnetic performance and efficient control of the hysteresis loop and specific absorption rate (SAR) are discussed.