Developing CNC programs for grinding parts with complex shapes is not a simple task. The programs tend to be long and need complicated calculations, because the programmer must control the whole surface of the grinding wheel not just cutter tip or tool diameter, as turning or milling. Also needed is the additional software for profiling and dressing the grinding wheels. There are no detail descriptions for resolving this problem in the literature or machine manuals. This paper presents a general algorithm to make the profiling and dressing programs for complicated shape grinding wheels easier. The programmer will use this algorithm for creating a subroutine suitable to CNC grinding machines, or an add-on grinding spindle, on CNC lathes. After storing the subroutine in the CNC unit, the programmer will then need only to fill in the parameters which describe the contour of the grinding wheels. This algorithm has been applied on an “addition grinding spindle” on a hollow spindle lathe equipped with a numerical control, Sinumeric 840C. Several complicated shape grinding wheels have been profiled and dressed using the proposed approaches, and satisfactory results were obtained.