In the documentation of fix external:
The fix has a set_callback() method which the external driver can call to pass a pointer to its foo() function. See the couple/lammps_quest/lmpqst.cpp file in the LAMMPS distribution for an example of how this is done. This sample application performs classical MD using quantum forces computed by a density functional code Quest.
though I don’t see subfolder lammps_quest in examples/COUPLE (also COUPLE should be capitalized I think).