Open Command Prompt and type
net start WAS
Then type
%windir%/system32/inetsrv/appcmd list wp
And there you have it
Another and easier way to obtain this information is through IIS Manager. Click the server in the left pane and the choose Worker Processes

Info originally found on http://dirk.net/2008/06/01/identify-which-w3wpexe-belongs-to-which-application-pool-in-iis7/