Using Python API to call a function in C ++ backend

I am trying to figure out how I can call a function in C++ backend using the Python API. I understand everything is interfaced through PackedFunc(as shown in this link . But I am not sure how this code needs to be organized and are there some other things that I need to add to invoke a C++ function from a Python API?

Any documents regarding this will be helpful. Thank You.