Carbon nitride-based materials, grown by magnetron sputtering have been studied concerning microstructure and mechanical properties. Carbon nitride was alloyed with Si or B, and grown as a constituent in a layered structure. Si-C-N thin films have been deposited by reactive co-sputtering of C and Si targets and the composition, microstructure, mechanical response, as well as wetting behavior have been examined. The microstructure of these films showed to be amorphous-to-graphite-like for binary SiC and ternary SiCN with low Si content. For ternaries with "high" Si content a nanostructured material was observed, containing 2-20 nm-sized crystallites in an amorphous matrix. A small addition of Si have shown to affect the wettability of CNx, displaying contact angle values similar to what has been reported for Si-doped DLC. High hardness but less elasticity as compared to CNx has been noticed. B-C-N thin films were grown by reactive magnetron co-sputtering at low substrate-temperature. The microstructure and indentation response of these films have been studied. A large area of the B-C-N compositional diagram was covered by reactive co-sputtering of graphite and B4C-targets. The B-C-N films were shown to exhibit fullerene-like microstructure, regardless of composition. The films showed high elasticity, comparable to what has been reported for CNx films grown under similar conditions. CN0.33/BN:C multilayers have been grown by sequential magnetron sputtering. The films exhibited a fullerene-like microstructure, consisting of curved and cross-linked basal planes, which were found to be continuous over the interfaces of the layers. Multilayers of CN0.33/BN:C reached improved values of displacement and elastic recovery compared to what was found for single-layer CN0.33 and BN:C films grown under comparable conditions.