The CodeProject now has an article about building an AJAX web part from scratch that calculates two numbers. It includes step by step instructions for setting up web.config to support AJAX. It can be accessed here: http://www.codeproject.com/useritems/MossAjaxWebPart.asp