Mesoporous materials with nanostructured building blocks and three-dimensionally ordered pore structure have attracted wide interest due to their potential applications in catalysis, optoelectronic and other advanced fields. In this article, the preparations of mesoporous materials composed of carbon and metal compounds including oxides, nitrides, sulfides and carbides via nanocasting routes has been introduced. Recent development has been also reviewed.