Thanks for posting and welcome to the KX community. I recently had post with questions regarding the C++ flexible material framework.
I would recommend watching the demo, and looking into the example source code from advanced material models section of KB. They have a number of models including non-linear, time variant and magnetic materials. It is usually easiest to modify the existing code which is most similar to your application.
Let me know if you have any more questions.
Suite 1700 - 1095 W. Pender St.
Vancouver, BC V6E 2M6