We present an efficient and general method to compute vortex-pinning interactions - which arise in neutron stars, superconductors, and trapped cold atoms - at arbitrary separations using real-time dynamics. This method overcomes uncertainties associated with matter redistribution by the vortex position and the related choice of ensemble that plague the typical approach of comparing energy differences between stationary pinned and unpinned configurations: uncertainties that prevent agreement in the literature on the sign and magnitude of the vortex-nucleus interaction in the crust of neutron stars. We demonstrate and validate the method with Gross-Pitaevskii-like equations for the unitary Fermi gas, and demonstrate how the technique of adiabatic state preparation with time-dependent simulation can be used to calculate vortex-pinning interactions in fermionic systems such as the vortex-nucleus interaction in the crust of neutron stars.