Are you familiar with publishing geoprocessing services with the map service to display the results? Basically it's the same process as that.
Watch for the limitations though.. you'll have to pass in strings instead of the actual raster layers/tables to that geoprocessing service. Took me like 2 weeks to get the whole process right. I was rewritting the weighted overlay tool as a flex service.