Characteristic Classes and Hitchin Systems. General Construction