grep -lr 'header\.h' /xx/* | xargs grep -l 'x('
The part in bold is the base directory for your code.
You might want to add .cc after the star to only match .cpp files.
There needs to be at least on .cc file in your base target directory.
You could also use
find </path/to/directory> -type f -name "*.cc" | xargs grep -l 'x('
Try the left hand side command first to see if you are getting a list of files. If you are, then add the | xargs ... part.