You are actually asking two different things, although they are related in a means-ends type relationship.
LEXICAL as in Lexical Categories: "A lexical category is a syntactic category for elements that are part of the lexicon of a language. These elements are at the word level [and are also] known as:
part of speech
grammatical class" (SIL International)
SEMANTICS: "Semantics is, generally defined, the study of meaning of linguistic expressions." (SIL International)
These SIL Glossary definitions show that the means of finished linguistic expressions (expressions made using language) are lexical categories, including grammatical classes or categories. These definitions show that the end result of a linguistic expression is semantic: linguistic expressions express meaning.
The lexical relationship to grammar is already clear: grammar is one of the lexical units, or building blocks, from which meaningful expressions are constructed. For instance, if you want to say that that person at the delicatessen owns that red car and that the car is a Volkswagen, you can choose lexical grammatical categories or classes to construct a semantically meaningful sentence, like these options:
- That man at the delicatessen owns the Volkswagen that is red.
- That man at the delicatessen owns the red car, which is a Volkswagen.
These grammatical constructions give different semantic importance to the make and color. The first option makes the man, Volkswagen make and red color equally important. The second makes the man and red car important while the make of car is nonessential to logical meaning; it is nonrestrictive, additional information. You might instead decide to emphasize the make and owner without giving importance to color by choosing different lexical grammatical units:
- That man at the delicatessen owns the Volkswagen, which is red.
Now you arrive at the semantic result of grammar: the expression of meaning. Changing your selection of lexical grammatical units (classes, categories) may change your expression of meaning. Our examples show changes in semantics, but these changes might be critical in various scenarios: perhaps a parking ticket is being given; perhaps a fender-bender accident occurred. Even small changes in lexical categories can potentially effect large changes in semantic meaning.
The above is how "the [semantic] meaning of a sentence is the product of both lexical and grammatical meaning" and how semantics and grammar interface with each other: lexical grammatical categories are the interface between semantics [meaning] and grammar [use of grammatical categories].