I'm currently on OPT and will be switching to H1B soon. I want to start a C corp which will function as an online business.
You're allowed to invest in a business, but you're not allowed to participate in a business.
Meaning - you can fund the company, but you cannot be an officer, director or employee. You cannot sign contracts, hire employees, sign statements etc. You can only be a passive investor. Basically, if you're the only investor - you'll be breaking the law one way or another.
Volunteering in lieu of employment is employment as far as USCIS are concerned.
If the development is done abroad, why don't you have your foreign counterparts incorporate and just act as an investor for their company?
This is not a legal advice.
Very important - have a co-founder for your C-corp and make him/her take every single role (president, treasury, etc), otherwise you will be considered an employee there even if you don't take any salary.