A class of macrocyclic compounds of formula (I), wherein R7, A, Ar, B, D, F, M, Q1, Q2, W, X, Y and Z are defined herein, that are useful as inhibitors of viral proteases, particularly the hepatitis C virus (HCV) NS3 protease, are provided. Also provided are processes for the synthesis and use of such macrocyclic compounds for treating or preventing HCV infection.