Another option for using less code would be to use the geoprocessing tools in model builder and export out the model to either VBScript, JScript, or Python script to tie in with your interface (see VBScript example below). You could also do this using ArcPy if you are using ArcGIS 10.