Here's one place with examples/source code:

http://support.sas.com/documentation/onlinedoc/guide/customtasks/

You can also look at this blog category:
http://blogs.sas.com/sasdummy/index.php?/categories/10-SAS-custom-tasks