I couldn't find an up-to-date full working tutorial on how to build linked-in drivers sync and async so here it is!.
In the branch linked-in-driver-sync, you will find a full working sync driver, as many tutorials around the Internet. But this one compiles and works for even R15 and is a full working example (storing PIDs etc).
In branch linked-in-driver-sync-no-global, the Pid is returned and not stored in ETS (@rvirding suggest it is cleaner).
In the default branch, you can find the async version.