It's a pretty complicated thing to design one. I highly recommend simply reading all the custom-controller threads here on ES, starting with Arlo1's, Lebowski's, etc. Most poeple start and quickly give up, though. It's a LOT of reading; there is no "tutorial" that will just walk you thru it. THere is a whole lotta stuff to learn first.
BTW, the first thing you can do is learn how the brushed controllers work, and how to make those work well. All of that will help you do the more complicated ones too.