We have developed a fully microscopic theory of magnetic properties of the prototype molecular magnet Mn12. First, the intra-molecular magnetic properties have been studied by means of first-principles density functional-based methods, with local correlation effects being taken into account within the local density approximation plus U (LDA+U) approach. Using the magnetic force theorem, we have calculated the interatomic isotropic and anisotropic exchange interactions and full tensors of single-ion anisotropy for each Mn ion. Dzyaloshinskii-Moriya (DM) interaction parameters turned out to be unusually large, reflecting a low symmetry of magnetic pairs in molecules, in comparison with bulk crystals. Based on these results we predict a distortion of ferrimagnetic ordering due to DM interactions. Further, we use an exact diagonalization approach allowing to work with as large Hilbert space dimension as 10^8 without any particular symmetry (the case of the constructed magnetic model). Based on the computational results for the excitation spectrum, we propose a distinct interpretation of the experimental inelastic neutron scattering spectra.