Photogenerated three-spin systems show great potential for applications in the field of molecular spintronics. In these systems, the exchange interaction in the electronically excited state dictates their magnetic properties. To design such molecules for specific applications, it is thus important to understand how the sign and magnitude of the exchange interaction can be controlled. For this purpose, we developed a perturbational approach, based on previous work by the groups of de Loth and Malrieu, that allows for the direct calculation of the exchange interaction and its individual contributions up to the second order and implemented it within the ORCA program package. Within this manuscript, we present the derivation of the individual second-order contributions, provide an overview of the implementation of the code and illustrate its performance. We show that, using this perturbational approach in combination with state-averaged orbitals from minimal active space calculations, accurate values for the exchange interaction can be computed for organic nitroxides. Further, we demonstrate that the weight of the ionic determinants in the orbital optimisation of the CASSCF procedure is crucial for the computation of accurate exchange couplings. In the case of photoexcited chromophore-radical systems, we find that the dynamic spin polarisation effect constitutes the most important contribution to the exchange interaction, whereby the sign of this contribution determines the sign of the exchange interaction.