Joey is the best in (his) class.
This is understood as "best student in his class", because a class contains students. Its exact meaning will still depend on the context that specifies what Joey is best in. "of his class" would not be appropriate unless the intended meaning is that Joey is the best that his class has to offer.
Joey is the best of Philadelphia.
Joey is the best in Philadelphia.
"best of Philadelphia" would mean "best asset of Philadelphia", meaning that Joey is an exemplary example of the people of Philadelphia, because "of" here denotes possession. This is the same usage as in "Best of Europe tour".
"best in Philadelphia" would mean "best [something] in Philadelphia", which would depend on the context. If the context is about a certain occupation or field, then it would refer to being the best in that occupation or field, like "If you are looking for a good plumber, Joey is the best in Philadelphia.".
Joey is the worst in the business.
"in" has to be used here because we want to refer to "someone in the business". "of" cannot be used since Joey cannot in any sense (at least I can't think of any context where it makes sense) be a possession of a "business", unlike "best of Philadelphia". Note that I've excluded other meanings of "of" because Joey is a person and not something that can describe or pertain to a "business".
Joey is the worst of his family.
Joey is the worst in his family.
Both are fine, but may mean different things. The first refers to "the worst member of his family" since Joey belongs to "his family" as a member. The second refers to "the worst [something] in his family", which as in earlier examples depend on the context, which may be about anything from morals to ability to rule a country.