Can a contractor refuse to pay a subcontractor until the contractor receives his payment from the company/client?
No. Some details missing in your description determine the type of claim you would have and the entity you would need to sue, but the sort of waiver on contingency that is presented to you is either inapplicable or devoid of legal merit.
If your work conditions meet the notion of pay period as defined in section 1 of the Employment Standards Act (this is of British Columbia, but other provinces very likely have similar legislation), the potential 30-day delay of payment clearly exceeds the delay allowed in section 17(1). Section 4 precludes any waiver of this and employee's other rights under the Act, whence the clause you mention is null and void to the extent it contravenes the Act. The fact that your contract is in writing or verbal makes no difference.
Even if (1) the client does not pay and (2) your work days don't meet the statutory definition of pay period or your work situation falls outside the scope of that legislation, you would still have against the client a claim of unjust enrichment. That being said, the statutory definition of "employee" (section 1) suggests that the client most likely is subject to the Act. If anything, the contractor's clause might have the effect of precluding claims [of breach] against him insofar as he does not benefit from the client's nonpayment of your work.
For enforcement of your rights in the event of a violation of the Act (or its provincial equivalent), see Parts 10-13. This does not necessarily preclude actionability of extra-legislative claims, such as the aforementioned unjust enrichment.