An approach to compute exchange parameters of the Heisenberg model in plane-wave-based methods is presented. This calculation scheme is based on the Greens function method and Wannier function projection technique. It was implemented in the framework of the pseudopotential method and tested on such materials as NiO, FeO, Li2MnO3, and KCuF3. The obtained exchange constants are in a good agreement with both the total energy calculations and experimental estimations for NiO and KCuF3. In the case of FeO our calculations explain the pressure dependence of the Neel temperature. Li2MnO3 turns out to be a Slater insulator with antiferromagnetic nearest-neighbor exchange defined by the spin splitting. The proposed approach provides a unique way to analyze magnetic interactions, since it allows one to calculate orbital contributions to the total exchange coupling and study the mechanism of the exchange coupling.