Multiorbital mean-field approach for bosons, spinor bosons, and Bose-Bose and Bose-Fermi mixtures in real-space optical lattices