Generally, H1B visa holders may only work as volunteers for positions which are typically unpaid positions (like at non-profits, charitable orgs, etc.). Volunteering for a position that is typically a paid position (like as an engineer, etc.) would most likely be viewed as unauthorized employment which violates the terms of the H1B. However, making an investment in a company without doing any work for the company and collecting any dividends is permissible while on an H1B.
Click here for the latest in immigration news!