in reply to C calling perl calling C

This is usually done using XS. See perlxs and perlxstut for some instruction on implementation.

An easier solution in your case may be to use the Inline::C module, which will autogenerate the XS wrapping for you.