Don't know what to do!

I have a question about motor and speed controller.

Where can I find code that control motor and speed controllers?
I mean, I know where I can find pwms, but how do I apply them with joystick?
I know it is simple question, but I am having hard time with this…
And, how do I control speed controller?