When airspaces adjoin vertically, which airspace class does the shared flight level or altitude belong to?
According to ICAO Annex 11 - ATS (Air Traffic Services)PDF, the less restrictive airspace is in effect on shared boundaries:


  Note.— Where the ATS airspaces adjoin vertically, i.e. one above the other, flights at a common level would comply with
  requirements of, and be given services applicable to, the less restrictive class of airspace. In applying these criteria, Class B
  airspace is therefore considered less restrictive than Class A airspace; Class C airspace less restrictive than Class B
  airspace, etc. 


Unless national regulations in the country's AIP are in contradiction or the national AIP does not list any information on this, the ICAO regulation will apply.

In the above example, the altitudes or flight level would be considered:

2500ft MSL: Class D airspace
4500ft MSL: Class E airspace, since class E is less restrictive than class D
FL100: Class E airspace, since Class E is less restrictive than class C

Related questions:
What is the difference between “flight level” and “altitude”?
What is the difference between the airspace's classes (for non-pilots)?