Inclusion Criteria:  Histologically or cytologically confirmed unresectable malignancy defined as one of the following:  Cohort 1: Relapsed and/or refractory metastatic melanoma  Uveal/ocular melanoma is excluded Must have progressed on treatment with an anti-PD-(L)1 mAb. PD-(L)1 treatment progression is defined as meeting all of the following criteria: Has received at least 2 doses of an approved anti-PD-(L)1 mAb Has demonstrated disease progression after PD-(L)1 as defined by RECIST v1.1. Progressive disease has been documented within 12 weeks from the last dose of anti- PD-(L)1 mAb  Last dose of anti-PD-(L)1 must have been within 90 days prior to enrollment  Cohort 2: Metastatic uveal melanoma  Must not have received prior treatment for advanced or metastatic disease except for prior adjuvant/neoadjuvant immunotherapy No prior regional, liver-directed therapy  Cohort 3: Metastatic PD-(L)1-naïve melanoma  Uveal/ocular melanoma is excluded Must not have received prior treatment for advanced or metastatic disease except for prior adjuvant/neoadjuvant immunotherapy. Participants with BRAF mutation, prior BRAF/MEK targeted therapy is allowed if completed 4 weeks prior to first dose of study treatment.  Cohorts 4 and 5: Non-squamous NSCLC  Participants must have stage IV disease per AJCC 8th edition No known driver mutations/alterations mutation for which targeted therapy is available Must have non-squamous histology. No prior therapy for metastatic disease No prior treatment with anti-PD-(L)1 or PD-L2 agent or an antibody targeting other immuno-regulatory receptors or mechanisms Able to provide archival tumor tissue from locations not radiated prior to biopsy Eastern Cooperative Oncology Group (ECOG) Performance Status score of 0 or 1 Measurable disease per RECIST v1.1 at baseline  Exclusion Criteria:  History of another malignancy within 3 years of first dose of study drug Active central nervous system (CNS) metastases and/or carcinomatous meningitis. Previous exposure to CD40-targeted therapy Currently on chronic systemic steroids in excess of physiologic replacement Has had an allogeneic tissue/solid organ transplant. History of autoimmune disease that has required systemic treatment in the past 2 years