With Resharper it can be done in two steps.
-
Set the checkbox “Add ‘using’ directive to the deepest scope” in
Code Editing→C#→Code Style→Reference qualification.

-
In the context menu of the solution choose “Cleanup Code…”.

You might want to create a custom cleanup pofile that suits your needs before performing the cleanup.
In ReSharper before v9 the setting is located somewhere else:
