This article can be considered as an extension of the paper of Fukagata et al. (Phys. Fluids 14:L73, 2002) who derived an analytical expression for the componential contributions into skin friction in a turbulent channel, pipe and plane boundary layer flows. In this paper, we extend theoretical analysis of Fukagata et al. limited to canonical cases with two-dimensional mean flow to a fully three-dimensional situation allowing complex wall shapes. We start our analysis by considering arbitrarily-shaped surfaces and then formulate a restriction on a surface shape for which the current analysis is valid. Theoretical formula for skin friction coefficient is thus given for streamwise and spanwise homogeneous surfaces of any shape, as well as some more complex configurations, including spanwise-periodic wavy patterns. Current theoretical analysis is validated using the results of Large Eddy Simulations of a turbulent flow over straight and wavy riblets with triangular and knife-blade cross-sections. Decomposition of skin friction into different componential contributions allows to analyze the influence of different dynamical effects on a drag modification by riblet-covered surfaces.