I want to create a workflow, which is update the task status if task is overdue. Can any body give me some code on this. Thanks
You could also use a feature on a timer job to look at all records on an interval, say every night, and make the appropriate escalations/notifications. Personally I think that's a better option than a "workflow" per say. Code wise it shouldn't be much outside of a feature with some API calls to analyze the data.
Here is a great example of a SharePoint Designer workflow with a "pause until date" action: http://sharepointsolutions.blogspot.com/2009/02/give-blood-to-your-workflow.html
You would want to get your date from the workflow data rather than hard-coding it.
Note that doing this the SPD workflow way will cause any actions after the pause to not continue until after the workflow wakes back up on the due date. That wouldn't be a problem for the ones that are overdue, but could be for the ones that are on time.
That said, I agree with webdes03 that a program called from a timer service would be a better option. You didn't mention if this is SharePoint 2010 or earlier. If 2010, it may be easier for you to code it as a console app in VB.NET or C#.NET using the Client Object Model and call it from the windows task scheduler.