Rotate an ASCII art image

C, 336 chars

I'm sure there's room for improvement.

char*a="<^>V|-|-/\\/\\ppdd(())[[]]{{}}MMWW9966",*p,*q;
n,x,y,r;
z(c){
    return(q=strchr(a,c))?a[(q-a&-4)+(q-a+r&3)]:c;
}
#define A(r)(r&3^3?1-r%4:0)*
f(r){
    return A(r)x+A(~-r)y+(r&2)/2*~-n;
}
main(){
    scanf("%d\n",&n);
    p=q=malloc(n*n+1);
    for(y=n;y--;q+=n)gets(q);
    scanf("%d",&r);
    for(r/=90;++y<n;puts(""))for(x=0;x<n;x++)putchar(z(p[f(r)+n*f(r+1)],r));
}

GolfScript, 79 75 73 67 chars

n%(;)~90/{-1%zip{{.'V<^>P(d)[{]}M9W6/\/\|-|'4/\+{.}%n+.@?)=}%}%}*n*

Looks like my and Peter Taylor's solutions are experiencing a certain amount of convergence. Anyway, looks like I'm still a few chars ahead for now. :-) Thanks (and +1) to both Peter and copy for ideas that I've shamelessly stolen.

This code completely ignores the size given on the first line, since it's redundant information. It should even handle inputs with non-square dimensions, but it very much depends on all the input lines being padded to the same length. Trying to rotate the characters P, d, (, ), [, ], {, }, M, W, 9, or 6 by 90 or 270 degrees may produce unexpected output; all other characters that are not explicitly remapped are retained unchanged.

Ps. Here's my original 79-char solution:

n%(;)~90/:z{-1%zip}*n*z'V<^>/|-\V>^<'{:c;{{.c?~.c=@if}%}*}:s~2z='P([{M96W}])d's

Golfscript (80 79 78 77 76 chars)

n%(;)~90/{zip{-1%{'V<^>V|-|/\/''Pd()[]{}MW96'{.4*}%4/128,+{.}%+.@?)=}%}%}*n*

NB Entering the "undefined behaviour" permitted by invalid input can produce somewhat curious output, because of placeholder characters (outside ASCII) used for certain characters whose rotation by 90 degrees is not defined. For example, ( would be mapped to code point 160, which in ISO-8859-1 and Unicode is a non-breaking space.