Do a search for ASSP (analysis services stored procedures) - it's a project on Codeplex. You can add these SP's (it's a compiled managed library) to your AS instance and then even use them as the source for calculated measures/members. There is an example of how to do just this to get the processed date as a calc member within a cube.
HTH,