We present a new force-field potential that describes the interlayer interactions in heterojunctions based on graphene and hexagonal boron nitride (h-BN). The potential consists of a long-range attractive term and a short-range anisotropic repulsive term. Its parameters are calibrated against reference binding and sliding energy profiles for a set of finite dimer systems and the periodic graphene/h-BN bilayer, obtained from density functional theory using a screened-exchange hybrid functional augmented by a many-body dispersion treatment of long-range correlation. Transferability of the parametrization is demonstrated by considering the binding energy of bulk graphene/h-BN alternating stacks. Benchmark calculations for the superlattice formed when relaxing the supported periodic heterogeneous bilayer provide good agreement with both experimental results and previous computational studies. For a free-standing bilayer we predict a highly corrugated relaxed structure. This, in turn, is expected to strongly alter the physical properties of the underlying monolayers. Our results demonstrate the potential of the developed force-field to model the structural, mechanical, tribological, and dynamic properties of layered heterostructures based on graphene and h-BN.