Here's the twin stick code I wrote for Square Off. You can test it out in Windows Phone/Android/iOS stores.
It supports a mode I call "free follow" where you can start the touch anywhere in the left/right side of the screen and the joystick will follow your finger if it gets too far away. That makes for the most playable virtual twin stick I find. This code doesn't draw the joystick for you, but that should be easy using SpriteBatch and doing something like this:
spriteBatch.Draw(... ... ,TouchTwinStick.leftStickPos, ...);
[EDIT] Forgot to mention some other features. Barring gesture recognition, it can probably replace all usages of TouchPanel. In fact it probably should because you don't want to be calling TouchPanel.GetTouches more than once a frame!:
- left/right stick direction fields (not normalised)
- left/right stick magnitude fields
- dead zone handling
- valid regions to initiate left/right stick movements
- justTouched and justTapped fields for simple touch and button press handling
- TouchCount and FirstTouch for easy checking of single finger input.
- GetGamepadState() (doesn't do buttons of course)