I think a good approach to thinking about this is to ask yourself whether you actually feel the need to do whatever action is being considered. For example, when someone says "I need to do my homework" they feel an inherent need, desire, or obligation to complete the assignment. But if you were to say instead that "My homework needs to be done," this implies that while you may realize that it is your responsibility to do your homework, you yourself do not necessarily feel the need to complete it.
The windows example would fall under the "it needs to be done" category, because you may not actually be too keen on cleaning the windows, even though they are dirty. Now if you were to say "I need to clean the windows", this would suggest that you actually feel the need to clean the windows, not simply that they need cleaning.
Sorry if my explanation is a little convoluted.