I wrote a blog post on writing a JIT that can handle FFI calls: http://blog.vmchale.com/article/jit
If you want the full monty, I think you'll have to read the LLVM documentation on JIT linking: https://llvm.org/docs/JITLink.html
I haven't found any academic papers or tutorials on JIT linking, unfortunately.