Since an H1-B or O-1 visa is an employment visa, it has to be used as an employee to work for an employer.
Two founders can form a board and hire each other, creating an employee-employer relationship to the business. This has been done with great success for O-1s; I doubt it would be as easy for an H-1B.
There isn’t a visa that allows immigrant or nonimmigrant intent to come to the U.S. and be self employed. Therefore your business structure must not contain a whiff of self employment.