The libdrc source code ships with 3 example demo programs:
3dtest: a rotating cube controller using analog sticks
simpleaudio: press the A button to get sound on the GamePad
tsdraw: use the touchscreen to draw on the GamePad
See the demos/ source code directory.