Q:

Count lines in files of type *.cpp and *.h only

I have already following bash script. It count lines in *.cpp only. How i can count line in the *.h file too without pugixml.cpp?
find . -type f  -name \*.cpp -and ! -name \pugixml.cpp -exec cat '{}' + | wc -l

A:

Use -o to look for files named *.cpp or *.h, and add parentheses for precedence. Note that I've removed the -and and the backslash in \pugixml as they were unnecessary (though harmless).
find . -type f \( -name \*.cpp -o -name \*.h \) ! -name pugixml.cpp -exec cat {} + | wc -l

Also you could reduce find -exec cat {} + | wc -l to simply find -exec wc -l {} +. That would show statistics for each individual file as well as a total count.
find . -type f \( -name \*.cpp -o -name \*.h \) ! -name pugixml.cpp -exec wc -l {} +

A:

Sounds like you really actually want sloccount.

