**Edit** This is the plan I have.
https://investor.vanguard.com/what-we-offer/small-business/individual-401kI also have an S-Corp and pay myself W2. You have two roles here. You are an employee of your corporation, and you are also the employer as the corporation.
As an employee, you can contribute the maximum of $17,500 this year. This comes from your W2 wages, so you need to be paying yourself at least the amount that you are contributing to your 401k.
As the employer, you are also allowed to contribute "profit sharing" to yourself as employee. This "profit sharing" can be a maximum of 25% of your W2 compensation, with a total max contribution from employee + employer of $51,000.
So basically you can contribute up to $17,500 as an employee, plus up to 25% of your W2 wages as an employer. Max would be $17,500 + whatever 25% of your W2 wages are, with the grand total being $51k max.
Here is the IRS link with actual examples, in case you aren't confused enough already.
http://www.irs.gov/Retirement-Plans/One-Participant-401(k)-Plans