Did you by any change try to rebuild DNN from the source files or something. The error you describe is exactly the same as this one: http://www.dnnportal.de/Default.aspx/tabid/178/g/posts/t/1219 (in german, i trust that is not a problem for you;))
further more, what rights did you give the asp.net worker proces for the directory dnn is running in?
what is the trust level you are running dnn in?
what are your other iis settings, like application pool (max number of processes, security settings) etc,
Did you try DNN 3.2.2 (its exactly the same as dnn 4.0.2, the only difference being that dnn 4.0.2 was compiled natively under asp.net 2.0)
cheers,
erik